package com.jt.Test;

import com.jt.demo1.Orders;
import com.jt.service.UserService;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TestService {
    @Test
    public void testOreders(){
        //1.加载spring配置文件
        ApplicationContext context = new ClassPathXmlApplicationContext("bean1.xml");
        //2.获取配置创建的对象(逗号前面对应的是配置文件bean里面的id)
        UserService userService = context.getBean("userService1", UserService.class);
        System.out.println(userService);
        userService.add();
    }
}
